<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="app">
        <!-- <temp>
            <h2>赋值的内容</h2>
        </temp> -->

        <temp2>
            <h2 slot="slot1">赋值的内容</h2>
        </temp2>
    </div>

    <template id="temp">
        <div>
            <slot>默认值</slot>
        </div>
    </template>

    <template id="temp2">
        <div>
            <slot name="slot1">默认值1</slot>
            <slot name="slot2">默认值2</slot>
        </div>
    </template>
</body>
</html>
<script src="js/vue.min.js"></script>
<script>
    var app=new Vue({
        el:"#app",
        data:{

        },
        components:{
            "temp":{
                template:"#temp"
            },
            "temp2":{
                template:"#temp2"
            }
        }
    });
</script>